package guij.controller;

import guij.dao.mapper.SubscriberMapper;
import guij.dao.vo.Subscriber;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;
//添加一个要订阅的 mail
public class AddMail implements Controller {

	@Override
	public ModelAndView handleRequest(HttpServletRequest arg0,
			HttpServletResponse arg1) throws Exception {
		String nick = arg0.getParameter("nick");
		String mail = arg0.getParameter("mail");
		String cycle = arg0.getParameter("cycle");
		
		Subscriber subscriber = new Subscriber();
		subscriber.setCycle(cycle);
		subscriber.setMail(mail);
		subscriber.setShopNikc(nick);
		
		subscriberMapper.add(subscriber);
		return new ModelAndView();
	}
	public void setViewPage(String viewPage) {
		this.viewPage = viewPage;
	}

	public String getViewPage() {
		return viewPage;
	}

	private String viewPage;
	SubscriberMapper subscriberMapper;

	public SubscriberMapper getSubscriberMapper() {
		return subscriberMapper;
	}

	public void setSubscriberMapper(SubscriberMapper subscriberMapper) {
		this.subscriberMapper = subscriberMapper;
	}


}
